import sys

from .backend import load_backend
from .distributed.nn.mindspore import *
from .distributed.optim.mindspore import *
from .optim.mindspore import *
# from . import torch

# if 'torch' not in sys.modules.keys():
#     sys.modules['torch'] = sys.modules[__name__ + '.torch']
for k in ['backend', 'distributed.nn.mindspore', 'distributed.optim.mindspore',
          'optim.mindspore']:
    if 'dgl.' + k not in sys.modules.keys():
        sys.modules['dgl.' + k] = sys.modules[__name__ + '.' + k]
        if k == 'backend':
            setattr(sys.modules['dgl.' + k], 'backend_name', 'mindspore')